mod advanced;
mod cognitive;
mod core;
mod error;

pub use advanced::AdvancedAgent;
pub use cognitive::CognitiveAgent;

/// 基础智能体类型
#[derive(Debug, Clone)]
pub enum AgentType {
    Producer,
    Consumer,
    Investor,
    Regulator,
}

/// 经济智能体结构
pub struct EconomicAgent {
    pub id: u32,
    pub agent_type: AgentType,
    pub cognitive_agent: Option<CognitiveAgent>,
    pub advanced_agent: Option<AdvancedAgent>,
    pub balance: f64,
}

impl EconomicAgent {
    /// 创建基础智能体
    pub fn new(id: u32, agent_type: AgentType) -> Self {
        EconomicAgent {
            id,
            agent_type,
            cognitive_agent: None,
            advanced_agent: None,
            balance: 1000.0,
        }
    }

    /// 升级为认知智能体
    pub fn upgrade_to_cognitive(&mut self) {
        self.cognitive_agent = Some(CognitiveAgent::new(self.id));
    }

    /// 升级为高级智能体
    pub fn upgrade_to_advanced(&mut self) {
        self.advanced_agent = Some(AdvancedAgent::new(self.id));
    }
}